#include "mediapushimpl.h"
#include "AsynchExecTask.h"
MediaPushImpl::MediaPushImpl()
{
	m_oAsynchExecTask = new AsynchExecTask;
	if (m_oAsynchExecTask)
		m_oAsynchExecTask->activate();
}

MediaPushImpl::~MediaPushImpl()
{
	if (m_oAsynchExecTask)
	{
		m_oAsynchExecTask->close();
		delete m_oAsynchExecTask;
	}
	m_oAsynchExecTask = NULL;
}

bool MediaPushImpl::Start(const std::string &url, AudioAction *pAudioAction, VideoAction *pVideoAction /*= NULL*/, MediaPushEvent *pMediaPushEvent /*= NULL*/)
{
	if (m_oAsynchExecTask)
		m_oAsynchExecTask->PutOnStart(url, pAudioAction, pVideoAction, pMediaPushEvent);
	return true;
}

bool MediaPushImpl::Stop()
{
	if (m_oAsynchExecTask)
		m_oAsynchExecTask->PutOnStop();

    return true;
}

